#!/bin/bash 

source ./test.cfg

DEBUG=0

if [ -z $1 ]; then
  NODE=msserver01a
  ID=APP1
  TOPIC=\$SharedSubscription/dog//APP/a01/#
else
  NODE=${APPLIANCE[$1]}
  ID=${APP[$1]}
  TOPIC=${SHARED}/APP/${ID}/#
fi

ID=C00000020
PW=svtpvtpass
ENDPOINT=`/niagara/test/scripts/getclusterserverendpointport.py -c ${CLUSTER} -e SVT-IntranetEndpoint -a ${NODE}`
gathersubserver=tcp://${ENDPOINT}
subserver=tcp://${ENDPOINT}
pubserver=tcp://${ENDPOINT}
MINUTES=5

if [ ${DEBUG} -ne 0 ]; then
  echo CLUSTER=${CLUSTER}
  echo NODE=${NODE}
  echo ENDPOINT=${ENDPOINT}
  echo QOS=${QOS}
  echo MESSAGES=${MESSAGES}
fi



echo test_template5_MQTTClient -a publish -mqtt 3.1.1 -q 2 -t /svtGroup0/chat -s ${pubserver} -i u0000020 -u u0000020 -p imasvtest -O -w 4000 -n 2000 -c false -v -vv


echo java svt.mqtt.mq.MqttSample -a publish -mqtt 3.1.1 -q ${QOS} -t /svtGroup0/chat -s ${pubserver} -i ${ID} -u ${ID} -p ${PW} ${ORDER} -w ${RATE} -n ${MESSAGES} -c false -v -vv
java svt.mqtt.mq.MqttSample -a publish -mqtt 3.1.1 -q ${QOS} -t /svtGroup0/chat -s ${pubserver} -i ${ID} -u ${ID} -p ${PW} ${ORDER} -w ${RATE} -n ${MESSAGES} -c false -v -vv


